/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.loja.view.swing.form;

import br.com.loja.model.entity.venda.ItemVenda;
import br.com.loja.mvp.presenter.IEntityPresenter;
import br.com.loja.mvp.view.EntityAttribute;

/**
 *
 * @author David Luiz
 */
@FormEntity(ItemVenda.class)
public class ItemVendaForm extends AbstractFormEntity<ItemVenda> {

    /**
     * Creates new form ItemVendaForm to netbeans
     */
    public ItemVendaForm() {
        super(null);
        initComponents();
    }

    public ItemVendaForm(IEntityPresenter<ItemVenda> presenter) {
        super(presenter);
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize
     * the form. WARNING: Do NOT modify this code. The content of this
     * method is always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        lblSubTotal = new javax.swing.JLabel();
        txtSubTotal = new javax.swing.JTextField();
        lblDescricao = new javax.swing.JLabel();
        scrollPane = new javax.swing.JScrollPane();
        txaDescricao = new javax.swing.JTextArea();
        lblQuantidade = new javax.swing.JLabel();
        spnQuantidade = new javax.swing.JSpinner();
        lblPreco = new javax.swing.JLabel();
        cbxPreco = new javax.swing.JComboBox();

        setBorder(javax.swing.BorderFactory.createEtchedBorder());
        java.awt.GridBagLayout layout = new java.awt.GridBagLayout();
        layout.columnWidths = new int[] {0, 3, 0, 3, 0, 3, 0};
        layout.rowHeights = new int[] {0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0};
        setLayout(layout);

        lblSubTotal.setFont(new java.awt.Font("sansserif", 0, 18)); // NOI18N
        lblSubTotal.setText("SubTotal");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 8;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(4, 6, 0, 0);
        add(lblSubTotal, gridBagConstraints);

        txtSubTotal.setFont(new java.awt.Font("sansserif", 0, 18)); // NOI18N
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 12;
        gridBagConstraints.gridwidth = 3;
        gridBagConstraints.ipadx = 180;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(4, 6, 6, 6);
        add(txtSubTotal, gridBagConstraints);

        lblDescricao.setFont(new java.awt.Font("sansserif", 0, 18)); // NOI18N
        lblDescricao.setText("Descrição");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 6, 0, 0);
        add(lblDescricao, gridBagConstraints);

        txaDescricao.setColumns(20);
        txaDescricao.setFont(new java.awt.Font("sansserif", 0, 18)); // NOI18N
        txaDescricao.setRows(5);
        scrollPane.setViewportView(txaDescricao);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.gridwidth = 7;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.ipadx = 273;
        gridBagConstraints.ipady = 113;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 1.0;
        gridBagConstraints.insets = new java.awt.Insets(6, 6, 0, 6);
        add(scrollPane, gridBagConstraints);

        lblQuantidade.setFont(new java.awt.Font("sansserif", 0, 18)); // NOI18N
        lblQuantidade.setText("Quantidade");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 6, 0, 0);
        add(lblQuantidade, gridBagConstraints);

        spnQuantidade.setFont(new java.awt.Font("sansserif", 0, 18)); // NOI18N
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 6;
        gridBagConstraints.gridwidth = 7;
        gridBagConstraints.ipadx = 256;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 6, 0, 6);
        add(spnQuantidade, gridBagConstraints);

        lblPreco.setFont(new java.awt.Font("sansserif", 0, 18)); // NOI18N
        lblPreco.setText("Preço");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 8;
        gridBagConstraints.gridheight = 3;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 6, 0, 0);
        add(lblPreco, gridBagConstraints);

        cbxPreco.setFont(new java.awt.Font("sansserif", 0, 18)); // NOI18N
        cbxPreco.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 12;
        gridBagConstraints.gridwidth = 3;
        gridBagConstraints.ipadx = 19;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 6, 6, 0);
        add(cbxPreco, gridBagConstraints);
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox cbxPreco;
    private javax.swing.JLabel lblDescricao;
    private javax.swing.JLabel lblPreco;
    private javax.swing.JLabel lblQuantidade;
    private javax.swing.JLabel lblSubTotal;
    private javax.swing.JScrollPane scrollPane;
    private javax.swing.JSpinner spnQuantidade;
    private javax.swing.JTextArea txaDescricao;
    private javax.swing.JTextField txtSubTotal;
    // End of variables declaration//GEN-END:variables

   
    /**
     * @return the spnQuantidade
     */
     @EntityAttribute(attribute = "quantidade")
    public javax.swing.JSpinner getSpnQuantidade() {
        return spnQuantidade;
    }

    /**
     * @return the txaDescricao
     */
     @EntityAttribute(attribute = "idItemVenda")
    public javax.swing.JTextArea getTxaDescricao() {
        return txaDescricao;
    }

    /**
     * @return the txtSubTotal
     */
     @EntityAttribute(attribute = "subTotal", editable = false)
    public javax.swing.JTextField getTxtSubTotal() {
        return txtSubTotal;
    }

}
